package de.waldemar;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;

public final class WindowUtils {
  private WindowUtils(){}
  
  public static void optimizedCentrilized(Window window) {
   
   Toolkit toolkit = Toolkit.getDefaultToolkit();
   Dimension screensize = toolkit.getScreenSize();
   Dimension windowDimension = window.getSize();
   
   window.setLocation((screensize.width / 2 - windowDimension.width / 2), (screensize.height / 2 - windowDimension.height / 2));
  }
}
